Skip to content

z65 - A Z-machine v3 interpreter for CP/M-65#263

Merged
davidgiven merged 37 commits intodavidgiven:masterfrom
venomix666:z65
Jan 24, 2026
Merged

z65 - A Z-machine v3 interpreter for CP/M-65#263
davidgiven merged 37 commits intodavidgiven:masterfrom
venomix666:z65

Conversation

@venomix666
Copy link
Contributor

As no computer should be without Zork, I wrote a a Z-machine interpreter for CP/M-65. It only supports v3 games, which seems to be the version used by most classic games and I wanted to avoid all the exceptions for v1 and v2, and supporting the newer version doesn't really make sense on limited hardware.

In order to run with as little TPA as possible (even though the binary is quite large...) I use a simple system with cached pages to load the needed static parts from disk as they are accessed. For the dynamic RAM, zmalloc is used to allocate it when the game header is loaded, so it should (hopefully) fail gracefully if it doesn't fit in the available memory.

The status bar is not implemented currently as the binary was getting large enough without it. I may try to implement this later and only show it if the screen driver is available.

Saving/restoring games is supported if the games implement it. There is no check if the restored file is for the correct game, so there is some potential for interesting crashes there.

I have tested it with Zork I-III, Mini-Zork, Planetfall, Hollywood Hijinx etc. and it all seems to work fine (although I'm sure there are still a lot of bugs hiding in there...).

z65 itself + the freeware 10k adventure Moonglow has been added to all platforms where it fits on the disk (i.e. all except BBC Micro, all Commodores, some Ataris, some OSI).

I put the code under third_party as this was like a small project of its own to write.

Below are some screenshots:

Zork I running on the Atari 800
zork_atari800xlhd

Mini-Zork running on the Oric
minizork-oric

Moonglow running on the Apple II
moonglow_apple_ii

Moonglow running on the BBC Micro
moonglow_bbc

Moonglow running on the C64
moonglow_c64

Moonglow running on the OSI600
moonglow_osi

venomix666 and others added 30 commits December 25, 2025 13:40
@davidgiven
Copy link
Owner

Very nice! (I do have prior Z-machine art; my game Changes came fourth in the annual Interactive Fiction competation in... 2004? But it was a Z5, and used every single byte of low memory, so I doubt it would work on CP/M-65 anyway.) Merging.

@davidgiven davidgiven merged commit df53428 into davidgiven:master Jan 24, 2026
1 check passed
@venomix666
Copy link
Contributor Author

Interesting! Maybe it is possible to get basic Z5 running, if you don't use the split screen functionality etc. but the amount of available dynamic memory would be less than with only Z3 for sure.

@davidgiven
Copy link
Owner

...on second thoughts, that game is written in I7 meaning it's not the quickest, and it also contains a fairly complicated ecosystem simulation and I did get comments that it's pretty sluggish even on new systems. I hate to think what it would be like on a 1MHz 6502.

Anyway, this is really cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments